﻿/*******************************************************************
Copyright (c) 2011 이재범

*  Permission is hereby granted, free of charge, to any person
*  obtaining a copy of this software and associated documentation
*  files (the "Software"), to deal in the Software without
*  restriction, including without limitation the rights to use,
*  copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the
*  Software is furnished to do so, subject to the following
*  conditions:
* 
*  The above copyright notice and this permission notice shall be
*  included in all copies or substantial portions of the Software.
* 
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
*  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
*  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
*  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
*  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
*  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
*  OTHER DEALINGS IN THE SOFTWARE.
*******************************************************************/

#include <string>
#include <Windows.h>
#include "common.h"
#pragma once
using namespace std;

class Data
{
	static const int max_data_size = 10000;  // 데이터의 최대 크기

protected:
	int data_size; // 데이터의 크기
	int data_location; // store_location 파일에 몇 번째로 저장되었는지
	string data;

public:
	string store_location; // 데이터의 저장된 경로

	Data();
	Data(string _store_location); 
	void load_data(char delimiter); // 데이터를 불러온다. (delimiter 은 구분자)
	void load_data();
	void load_tex_data();
	void save_data(string _store_location);
	void save_data();
	void append_data(string _store_location);

	void set_store_location(string _store_location)
	{
		store_location = _store_location;
	}
	void set_data_size(int _data_size)
	{
		data_size = _data_size;
	}

	string& get_data() { return data; }
};